import { myEnv } from '@/myEnv';
import { Immit } from '@/utils';

export abstract class Activities_Abs extends Immit {
    /** 活动主键 */
    id: string = '';
    /** 活动名称 */
    name: string = '';
    /** 活动开始时间 */
    startTime: DeteStr = '';
    /** 活动结束时间 */
    endTime: DeteStr = '';
    /** 活动图片 */
    imgUrl: string = '';
}

export class Activities_Res extends Activities_Abs {}

export class Activities_Web extends Activities_Abs {
    immit_response?(data: Partial<Activities_Res>) {
        this.immit(data);
        this.imgUrl = myEnv.BASE_URL + data.imgUrl;
        this.startTime = new Date(data.startTime).toLocaleString();
        this.endTime = new Date(data.endTime).toLocaleString();
        return this;
    }
}
